home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.teleport.com!usenet
- From: GHouck <hksys@teleport.com>
- Newsgroups: comp.lang.c++
- Subject: Re: emergency! need help..... please
- Date: 23 Feb 1996 05:29:15 GMT
- Organization: systems hk
- Message-ID: <4gjjbb$mhd@maureen.teleport.com>
- References: <4ggqqj$fen@cloner4.netcom.com>
- NNTP-Posting-Host: ip-pdx20-13.teleport.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
-
- wells2@ix.netcom.com (wells) wrote:
- >why doesnt this work???
- >
- >#include <stdio.h>
- >#include <iostream.h>
- >#include <math.h>
- >
- >void main(void)
- >{
- > float l; // loan amount
- > float r; // interest rate
- > int n; // number of payments
- > float p; // payment
- > float a,b,c,d;
- > cout << "Enter the full loan amount ->";
- > cin >> l;
- > cout << "\n Enter the interest rate ->";
- > cin >> r;
- > cout << "\n Enter the number of payments ->";
- > cin >> n;
- > r=r/1200;
- > a=(l+r);
- > b=pow(a,n)*r;
- > c=(l+r);
- > d=pow(c,n)-1;
- > p=((b/d)*l);
- > cout << p;
- > }
- >
- Hi,
- It looks like to me that your '(1+r)' quantities actually contain
- 'l' (ELL) rather than '1' (ONE). Should it not be the (rate + one)?
- Yours, Geoff Houck
-
-